package lmycc.test.demo.service;

import lmycc.test.demo.domain.Menu;
import lmycc.test.demo.repository.MenuRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
@Transactional
@Component
public class MenuService {
    @Autowired
    private MenuRepository menuRepository;

    public List<Menu> findAll() {
        return menuRepository.findAll();
    }

    public void insertMenu(Menu menu) {
        menuRepository.save(menu);
    }
}
